<style>
* {
	box-sizing: border-box;
	font-family: 'Trebuchet MS', 'Arial Unicode MS', sans-serif;
	font-weight: normal;
}

/* section class */
.Top-Leagues {
	font-family: 'Trebuchet MS', 'Arial Unicode MS', sans-serif;
	margin: 5px 5px 5px 5px;
}

/*section header clas */
.Top-Leagues-Header {
	/* background-color: #075eea; */
	color: #fbfafa;
	width: 100%;
	padding: 4px 8px;
	text-align: left;
	font-size: 16px;
	/* border-radius: 5px 5px 0px 0px; */
	line-height: 24px !important;
	/* height: 32px; */
	border-top: 1px solid #535353;
    /* border-top: 1px solid #075eea; */
	margin: 0px;
}

#top-leagues-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 5px;
    background-color: #333;
}

/* Make last item full width ONLY if it’s alone on the last row */
#top-leagues-banner-grid > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.top-leagues-banner-holder {
	text-align: left;
}

.top-leagues-banner-holder a {
	text-decoration: none;
}

.top-league-button {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 3px 3px 3px 3px;
	overflow: hidden;
	text-decoration: none;
	width: 100%;
	margin: auto;
}

.top-league-button img {
	width: 16px;
	object-fit: cover; /* Make image cover the whole banner area */
	text-align: left;
	opacity: 0.9;
}

.top-league-name-holder {
	position: relative;
	margin: auto;
	width: 100%;
	display: flex;
	justify-content: space-between; /* Distribute text and logo */
	align-items: center;
	/* background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
	padding: 8px 8px;
	color: #fbfafa;
	background-color: #5d5d5c;
	text-decoration: none;
}

.top-league-name-holder:hover {
	background-color: #7d7d7c;
}

.top-league-name {
	font-size: 12px;
	font-weight: bold;
	text-align: left;
}

.fa-fire-flame-curved {
	font-size: 16px;
	margin-right: 4px;
}

.top-leagues-icon {
	font-size: 16px;
	opacity: 0.5;
}

.top-leagues-all {
	font-size: 11px;
	color: #eabd31;
	margin-left: 5px;
	opacity: 0.8;
}

.top-leagues-all-text {
	font-size: 11px;
	color: #7d7d7c;
	float: right;
	/* border: 1px solid #b8b6b5; */
    /* border-radius: 5px; */
    /* padding: 0 10px; */
}

.top-leagues-all-text:hover {
	color: #eabd31;
	opacity: 0.8;
}

@media (max-width: 350px) {
  /* For tablets and smaller screens, make it 2 columns and 2 rows */
  #top-leagues-banner-grid {
    grid-template-columns: repeat(1, 1fr); /* 2 columns */
  }
}

@media (min-width: 351px) and (max-width: 768px) {
  /* For tablets and smaller screens, make it 2 columns and 2 rows */
  #top-leagues-banner-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* For medium screens (tablets), adjust to 2 columns */
    #top-leagues-banner-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 1 item in last row */
    #top-leagues-banner-grid > div:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1025px) {
  /* For larger screens (desktops), adjust to 4 columns */
    #top-leagues-banner-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* 1 item in last row → full width */
    #top-leagues-banner-grid > div:last-child:nth-child(4n + 1) {
        grid-column: 2 / -2;
    }

    /* 2 items in last row → each spans 2 columns */
    #top-leagues-banner-grid > div:nth-last-child(2):nth-child(4n + 1),
    #top-leagues-banner-grid > div:last-child:nth-child(4n + 2) {
        grid-column: span 2;
    }
}
</style>
